/*
MySQL Backup
Database: trade_monitor
Backup Time: 2025-10-15 15:52:01
*/

SET FOREIGN_KEY_CHECKS=0;
DROP TABLE IF EXISTS `trade_monitor`.`config`;
DROP TABLE IF EXISTS `trade_monitor`.`products`;
DROP TABLE IF EXISTS `trade_monitor`.`trade_orders`;
DROP TABLE IF EXISTS `trade_monitor`.`trade_records`;
DROP TABLE IF EXISTS `trade_monitor`.`user_sessions`;
DROP TABLE IF EXISTS `trade_monitor`.`users`;
CREATE TABLE `config` (
  `id` int NOT NULL AUTO_INCREMENT,
  `key` varchar(255) NOT NULL,
  `value` varchar(255) NOT NULL,
  `description` text,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `key_idx` (`key`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
CREATE TABLE `products` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `exchange_code` varchar(255) NOT NULL,
  `margin` double NOT NULL,
  `stoploss` double NOT NULL,
  `takeprofit` double NOT NULL,
  `limit_stoploss` double DEFAULT NULL,
  `mtp` varchar(255) DEFAULT NULL,
  `dks` varchar(255) DEFAULT NULL,
  `is_monitored` int DEFAULT NULL,
  `add_time` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `name_idx` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
CREATE TABLE `trade_orders` (
  `order_id` varchar(64) NOT NULL,
  `symbol` varchar(32) NOT NULL,
  `direction` enum('BUY','SELL') NOT NULL,
  `offset_flag` enum('OPEN','CLOSE','CLOSETODAY') NOT NULL,
  `price` decimal(18,4) NOT NULL,
  `volume` int NOT NULL,
  `traded_volume` int DEFAULT '0',
  `status` enum('PENDING','PARTIAL','FILLED','CANCELLED','REJECTED') NOT NULL,
  `order_time` datetime NOT NULL,
  `update_time` datetime NOT NULL,
  PRIMARY KEY (`order_id`),
  KEY `idx_symbol` (`symbol`),
  KEY `idx_status` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
CREATE TABLE `trade_records` (
  `id` int NOT NULL AUTO_INCREMENT,
  `order_id` varchar(64) DEFAULT NULL,
  `product_name` varchar(255) NOT NULL,
  `direction` varchar(255) NOT NULL,
  `offset` varchar(255) NOT NULL,
  `volume` double NOT NULL,
  `price` double NOT NULL,
  `reason` text,
  `timestamp` datetime NOT NULL,
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `fk_order_id` (`order_id`),
  CONSTRAINT `fk_order_id` FOREIGN KEY (`order_id`) REFERENCES `trade_orders` (`order_id`)
) ENGINE=InnoDB AUTO_INCREMENT=124 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
CREATE TABLE `user_sessions` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `session_token` varchar(64) DEFAULT NULL,
  `expires_at` datetime DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ix_user_sessions_id` (`id`),
  KEY `ix_user_sessions_session_token` (`session_token`),
  KEY `ix_user_sessions_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
CREATE TABLE `users` (
  `id` int NOT NULL AUTO_INCREMENT,
  `username` varchar(50) DEFAULT NULL,
  `password_hash` varchar(128) DEFAULT NULL,
  `salt` varchar(32) DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT NULL,
  `is_admin` tinyint(1) DEFAULT NULL,
  `session_duration` int DEFAULT NULL,
  `last_login` datetime DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ix_users_id` (`id`),
  KEY `ix_users_username` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
BEGIN;
LOCK TABLES `trade_monitor`.`config` WRITE;
DELETE FROM `trade_monitor`.`config`;
INSERT INTO `trade_monitor`.`config` (`id`,`key`,`value`,`description`,`updated_at`) VALUES (1, 'open_auto', 'on', '是否允许自动开仓，on允许,off不允许', '2025-07-24 08:47:41'),(2, 'other', 'on', '该配置项没有实际意义，测试一下', '2025-09-06 20:21:58'),(3, 'math_open_lots', 'on', '是否由算法决定开仓量', '2025-08-20 03:55:02'),(4, 'theme', 'dark', 'Application theme (light/dark)', '2025-09-08 20:12:51');
UNLOCK TABLES;
COMMIT;
BEGIN;
LOCK TABLES `trade_monitor`.`products` WRITE;
DELETE FROM `trade_monitor`.`products`;
INSERT INTO `trade_monitor`.`products` (`id`,`name`,`exchange_code`,`margin`,`stoploss`,`takeprofit`,`limit_stoploss`,`mtp`,`dks`,`is_monitored`,`add_time`) VALUES (1, '豆油2605', 'DCE.y2609', 20000, 60, 10, 3000, '1', '双向', 1, '2025-07-23 07:44:22'),(2, '铁矿石2601', 'DCE.i2601', 25000, 70, 1000, 3000, '15', '双向', 1, '2025-07-23 07:44:22'),(3, '甲醇2509', 'CZCE.MA2509', 2800, 35, 10, 3000, '15', '双向', 0, '2025-07-23 07:44:22'),(4, '沥青2509', 'SHFE.bu2509', 4200, 25, 10, 3000, '5', '双向', 0, '2025-07-23 07:44:22'),(5, '热轧卷板2509', 'SHFE.hc2509', 4800, 45, 10, 3000, '5', '双向', 0, '2025-07-23 07:44:22'),(6, '棉花601', 'CZCE.CF601', 15000, 150, 5, 3000, '1', '双向', 1, '2025-07-23 07:44:22'),(7, '菜籽粕2509', 'CZCE.RM2509', 3200, 28, 10, 3000, '60', '双向', 0, '2025-07-23 07:44:22'),(8, '动力煤2509', 'CZCE.ZC2509', 6800, 15, 100, 3000, '5', '双向', 0, '2025-07-23 07:44:22'),(9, '沪镍2509', 'SHFE.ni2509', 28000, 500, 1, 3000, '5', '双向', 0, '2025-07-23 07:44:22'),(10, '白银2601', 'SHFE.ag2601', 8500, 5, 15, 3000, '5', '双向', 1, '2025-07-23 07:44:22'),(11, '螺纹钢2501', 'SHFE.rb2501', 5000, 50, 10, 3000, '5', '双向', 0, '2025-07-23 07:44:22'),(13, '沪铜2601', 'SHFE.cu2601', 35000, 200, 5, 3000, '5', '双向', 1, '2025-07-23 07:44:22'),(14, '沪深300', 'CFFEX.IF2409', 120000, 30, 300, 3000, '15', '双向', 0, '2025-07-23 07:44:22'),(15, '黄金2601', 'SHFE.au2601', 10000, 20, 1000, 3000, '1', '双向', 1, '2025-07-23 07:44:22'),(16, '原油2409', 'INE.sc2409', 80000, 10, 100, 3000, '15', '双向', 0, '2025-07-23 07:44:22'),(17, '豆粕2501', 'DCE.m2501', 4500, 40, 10, 3000, '30', '双向', 0, '2025-07-23 07:44:22'),(18, 'PTA2501', 'CZCE.TA2501', 3500, 60, 5, 3000, '5', '双向', 0, '2025-07-23 07:44:22'),(19, '玻璃2501', 'CZCE.FG2501', 3000, 30, 20, 3000, '5', '双向', 0, '2025-07-23 07:44:22'),(20, '白糖2501', 'CZCE.SR2501', 4000, 40, 10, 3000, '15', '双向', 0, '2025-07-23 07:44:22'),(21, '螺纹钢2605', 'SHFE.rb2605', 15000, 50, 120, 2000, '1', '双向', 1, '2025-07-23 08:20:57'),(22, '氧化铝2601', 'SHFE.ao2601', 20000, 50, 1500, 2000, '1', '双向', 1, '2025-07-23 09:50:16'),(23, '棕榈油2605', 'DCE.p2605', 20000, 30, 500, 1000, '1', '双向', 1, '2025-07-23 10:29:12'),(24, '焦煤2601', 'DCE.jm2601', 30000, 50, 5000, 3000, '1', '双向', 1, '2025-07-28 13:20:15'),(25, '焦炭2601', 'DCE.j2601', 50000, 50, 500, 3000, '3', '双向', 1, '2025-09-01 13:40:15'),(26, '红枣2605', 'CZCE.CJ605', 10000, 50, 50, 3000, '15', '双向', 1, '2025-10-11 17:29:53');
UNLOCK TABLES;
COMMIT;
BEGIN;
LOCK TABLES `trade_monitor`.`trade_orders` WRITE;
DELETE FROM `trade_monitor`.`trade_orders`;
UNLOCK TABLES;
COMMIT;
BEGIN;
LOCK TABLES `trade_monitor`.`trade_records` WRITE;
DELETE FROM `trade_monitor`.`trade_records`;
INSERT INTO `trade_monitor`.`trade_records` (`id`,`order_id`,`product_name`,`direction`,`offset`,`volume`,`price`,`reason`,`timestamp`,`created_at`) VALUES (3, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 1, 3321, '均线追踪止损', '2025-08-08 17:15:28', '2025-08-08 09:15:28'),(4, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 1, 3321, '均线追踪止损', '2025-08-08 17:15:28', '2025-08-08 09:15:28'),(5, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 1, 3321, '均线追踪止损', '2025-08-08 17:15:28', '2025-08-08 09:15:28'),(6, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 20, 3321, '均线追踪止损', '2025-08-08 17:18:46', '2025-08-08 09:18:46'),(7, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 1, 3321, '均线追踪止损', '2025-08-08 17:18:50', '2025-08-08 09:18:50'),(8, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 1, 3321, '均线追踪止损', '2025-08-08 17:18:50', '2025-08-08 09:18:50'),(9, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 1, 3321, '均线追踪止损', '2025-08-08 17:18:51', '2025-08-08 09:18:51'),(10, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 1, 3321, '均线追踪止损', '2025-08-08 17:18:51', '2025-08-08 09:18:51'),(11, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 1, 3321, '均线追踪止损', '2025-08-08 17:18:51', '2025-08-08 09:18:51'),(12, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 2, 3321, '均线追踪止损', '2025-08-08 17:18:51', '2025-08-08 09:18:51'),(13, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 2, 3321, '均线追踪止损', '2025-08-08 17:18:52', '2025-08-08 09:18:52'),(14, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 1, 3321, '均线追踪止损', '2025-08-08 17:18:52', '2025-08-08 09:18:52'),(15, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 1, 3321, '均线追踪止损', '2025-08-08 17:18:52', '2025-08-08 09:18:52'),(16, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 11, 3321, '均线追踪止损', '2025-08-08 17:19:47', '2025-08-08 09:19:47'),(17, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 1, 3321, '均线追踪止损', '2025-08-08 17:19:51', '2025-08-08 09:19:51'),(18, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 1, 3321, '均线追踪止损', '2025-08-08 17:19:52', '2025-08-08 09:19:52'),(19, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 1, 3321, '均线追踪止损', '2025-08-08 17:19:52', '2025-08-08 09:19:52'),(20, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 1, 3321, '均线追踪止损', '2025-08-08 17:19:52', '2025-08-08 09:19:52'),(21, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 1, 3321, '均线追踪止损', '2025-08-08 17:19:52', '2025-08-08 09:19:52'),(22, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 2, 3321, '均线追踪止损', '2025-08-08 17:19:53', '2025-08-08 09:19:53'),(23, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 2, 3321, '均线追踪止损', '2025-08-08 17:19:53', '2025-08-08 09:19:53'),(24, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 1, 3321, '均线追踪止损', '2025-08-08 17:19:53', '2025-08-08 09:19:53'),(25, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 1, 3321, '均线追踪止损', '2025-08-08 17:19:53', '2025-08-08 09:19:53'),(26, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 1, 3321, '均线追踪止损', '2025-08-08 17:19:54', '2025-08-08 09:19:54'),(27, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 1, 3321, '均线追踪止损', '2025-08-08 17:19:59', '2025-08-08 09:19:59'),(28, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 1, 3321, '均线追踪止损', '2025-08-08 17:19:59', '2025-08-08 09:19:59'),(29, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 1, 3321, '均线追踪止损', '2025-08-08 17:20:00', '2025-08-08 09:20:00'),(30, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 1, 3321, '均线追踪止损', '2025-08-08 17:20:00', '2025-08-08 09:20:00'),(31, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 1, 3321, '均线追踪止损', '2025-08-08 17:20:00', '2025-08-08 09:20:00'),(32, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 2, 3321, '均线追踪止损', '2025-08-08 17:20:00', '2025-08-08 09:20:00'),(33, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 2, 3321, '均线追踪止损', '2025-08-08 17:20:01', '2025-08-08 09:20:01'),(34, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 2, 3321, '均线追踪止损', '2025-08-08 17:20:01', '2025-08-08 09:20:01'),(35, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 2, 3321, '均线追踪止损', '2025-08-08 17:20:01', '2025-08-08 09:20:01'),(36, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 2, 3321, '均线追踪止损', '2025-08-08 17:20:01', '2025-08-08 09:20:01'),(37, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 2, 3321, '均线追踪止损', '2025-08-08 17:20:02', '2025-08-08 09:20:02'),(38, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 3, 3321, '均线追踪止损', '2025-08-08 17:20:02', '2025-08-08 09:20:02'),(39, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 3, 3321, '均线追踪止损', '2025-08-08 17:20:02', '2025-08-08 09:20:02'),(40, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 3, 3321, '均线追踪止损', '2025-08-08 17:20:02', '2025-08-08 09:20:02'),(41, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 3, 3321, '均线追踪止损', '2025-08-08 17:20:03', '2025-08-08 09:20:03'),(42, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 3, 3321, '均线追踪止损', '2025-08-08 17:20:03', '2025-08-08 09:20:03'),(43, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 3, 3321, '均线追踪止损', '2025-08-08 17:20:03', '2025-08-08 09:20:03'),(44, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 4, 3321, '均线追踪止损', '2025-08-08 17:20:03', '2025-08-08 09:20:03'),(45, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 4, 3321, '均线追踪止损', '2025-08-08 17:20:04', '2025-08-08 09:20:04'),(46, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 4, 3321, '均线追踪止损', '2025-08-08 17:20:04', '2025-08-08 09:20:04'),(47, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 4, 3321, '均线追踪止损', '2025-08-08 17:20:04', '2025-08-08 09:20:04'),(48, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 4, 3321, '均线追踪止损', '2025-08-08 17:20:04', '2025-08-08 09:20:04'),(49, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 4, 3321, '均线追踪止损', '2025-08-08 17:20:05', '2025-08-08 09:20:05'),(50, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 5, 3321, '均线追踪止损', '2025-08-08 17:20:05', '2025-08-08 09:20:05'),(51, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 5, 3321, '均线追踪止损', '2025-08-08 17:20:05', '2025-08-08 09:20:05'),(52, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 5, 3321, '均线追踪止损', '2025-08-08 17:20:05', '2025-08-08 09:20:05'),(53, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 5, 3321, '均线追踪止损', '2025-08-08 17:20:06', '2025-08-08 09:20:06'),(54, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 5, 3321, '均线追踪止损', '2025-08-08 17:20:06', '2025-08-08 09:20:06'),(55, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 5, 3321, '均线追踪止损', '2025-08-08 17:20:06', '2025-08-08 09:20:06'),(56, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 6, 3321, '均线追踪止损', '2025-08-08 17:20:06', '2025-08-08 09:20:06'),(57, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 6, 3321, '均线追踪止损', '2025-08-08 17:20:07', '2025-08-08 09:20:07'),(58, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 6, 3321, '均线追踪止损', '2025-08-08 17:20:07', '2025-08-08 09:20:07'),(59, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 6, 3321, '均线追踪止损', '2025-08-08 17:20:07', '2025-08-08 09:20:07'),(60, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 6, 3321, '均线追踪止损', '2025-08-08 17:20:08', '2025-08-08 09:20:08'),(61, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 6, 3321, '均线追踪止损', '2025-08-08 17:20:08', '2025-08-08 09:20:08'),(62, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 7, 3321, '均线追踪止损', '2025-08-08 17:20:08', '2025-08-08 09:20:08'),(63, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 7, 3321, '均线追踪止损', '2025-08-08 17:20:08', '2025-08-08 09:20:08'),(64, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 7, 3321, '均线追踪止损', '2025-08-08 17:20:09', '2025-08-08 09:20:09'),(65, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 7, 3321, '均线追踪止损', '2025-08-08 17:20:09', '2025-08-08 09:20:09'),(66, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 7, 3321, '均线追踪止损', '2025-08-08 17:20:09', '2025-08-08 09:20:09'),(67, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 7, 3321, '均线追踪止损', '2025-08-08 17:20:09', '2025-08-08 09:20:09'),(68, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 8, 3321, '均线追踪止损', '2025-08-08 17:20:10', '2025-08-08 09:20:10'),(69, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 8, 3321, '均线追踪止损', '2025-08-08 17:20:10', '2025-08-08 09:20:10'),(70, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 8, 3321, '均线追踪止损', '2025-08-08 17:20:10', '2025-08-08 09:20:10'),(71, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 8, 3321, '均线追踪止损', '2025-08-08 17:20:10', '2025-08-08 09:20:10'),(72, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 8, 3321, '均线追踪止损', '2025-08-08 17:20:11', '2025-08-08 09:20:11'),(73, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 8, 3321, '均线追踪止损', '2025-08-08 17:20:11', '2025-08-08 09:20:11'),(74, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 9, 3321, '均线追踪止损', '2025-08-08 17:20:11', '2025-08-08 09:20:11'),(75, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 9, 3321, '均线追踪止损', '2025-08-08 17:20:11', '2025-08-08 09:20:11'),(76, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 9, 3321, '均线追踪止损', '2025-08-08 17:20:12', '2025-08-08 09:20:12'),(77, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 9, 3321, '均线追踪止损', '2025-08-08 17:20:12', '2025-08-08 09:20:12'),(78, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 10, 3321, '均线追踪止损', '2025-08-08 17:20:12', '2025-08-08 09:20:12'),(79, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 10, 3321, '均线追踪止损', '2025-08-08 17:20:12', '2025-08-08 09:20:12'),(80, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 10, 3321, '均线追踪止损', '2025-08-08 17:20:13', '2025-08-08 09:20:13'),(81, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 10, 3321, '均线追踪止损', '2025-08-08 17:20:13', '2025-08-08 09:20:13'),(82, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 10, 3321, '均线追踪止损', '2025-08-08 17:20:13', '2025-08-08 09:20:13'),(83, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 11, 3321, '均线追踪止损', '2025-08-08 17:20:14', '2025-08-08 09:20:14'),(84, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 11, 3321, '均线追踪止损', '2025-08-08 17:20:14', '2025-08-08 09:20:14'),(85, NULL, 'DCE.jm2601', 'BUY', 'CLOSE', 7, 1170.5, '均线追踪止损', '2025-08-27 12:42:32', '2025-08-27 12:42:32'),(86, NULL, 'DCE.jm2601', 'SELL', 'CLOSE', 2, 1167, '均线追踪止损', '2025-08-27 13:30:05', '2025-08-27 13:30:05'),(87, NULL, 'DCE.jm2601', 'SELL', 'CLOSE', 1, 1164.5, '均线追踪止损', '2025-08-27 13:30:45', '2025-08-27 13:30:45'),(88, NULL, 'DCE.jm2601', 'SELL', 'CLOSE', 1, 1164.5, '均线追踪止损', '2025-08-27 13:30:46', '2025-08-27 13:30:46'),(89, NULL, 'DCE.jm2601', 'SELL', 'CLOSE', 3, 1165, '均线追踪止损', '2025-08-27 13:30:56', '2025-08-27 13:30:56'),(90, NULL, 'SHFE.ao2601', 'BUY', 'CLOSETODAY', 1, 3019, '均线追踪止损', '2025-08-31 10:18:25', '2025-08-31 10:18:25'),(91, NULL, 'SHFE.ao2601', 'BUY', 'CLOSETODAY', 3, 3007, '均线追踪止损', '2025-09-01 14:01:01', '2025-09-01 14:01:01'),(92, NULL, 'SHFE.ao2601', 'BUY', 'CLOSETODAY', 3, 3007, '均线追踪止损', '2025-09-01 14:38:01', '2025-09-01 14:38:01'),(93, NULL, 'CZCE.CF601', 'SELL', 'CLOSE', 4, 13960, '均线追踪止损', '2025-09-05 21:24:48', '2025-09-05 21:24:48'),(94, NULL, 'DCE.p2605', 'SELL', 'CLOSE', 3, 9258, '均线追踪止损', '2025-09-05 21:32:02', '2025-09-05 21:32:02'),(95, NULL, 'SHFE.ao2601', 'SELL', 'CLOSETODAY', 3, 2971, '均线追踪止损', '2025-09-05 21:49:02', '2025-09-05 21:49:02'),(96, NULL, 'SHFE.rb2605', 'SELL', 'CLOSETODAY', 4, 3177, '均线追踪止损', '2025-09-05 21:50:02', '2025-09-05 21:50:02'),(97, NULL, 'CZCE.CF601', 'SELL', 'CLOSE', 12, 13960, '均线追踪止损', '2025-09-05 21:52:02', '2025-09-05 21:52:02'),(98, NULL, 'DCE.jm2601', 'SELL', 'CLOSE', 2, 1149.5, '均线追踪止损', '2025-09-05 21:53:02', '2025-09-05 21:53:02'),(99, NULL, 'SHFE.ao2601', 'BUY', 'CLOSETODAY', 3, 2970, '均线追踪止损', '2025-09-05 22:55:21', '2025-09-05 22:55:21'),(100, NULL, 'SHFE.ao2601', 'BUY', 'CLOSETODAY', 3, 2917, '均线追踪止损', '2025-09-29 11:33:28', '2025-09-29 11:33:28'),(101, NULL, 'DCE.jm2601', 'SELL', 'CLOSE', 2, 1156.5, '均线追踪止损', '2025-09-29 14:46:15', '2025-09-29 14:46:16'),(102, NULL, 'DCE.p2605', 'SELL', 'CLOSE', 3, 9044, '均线追踪止损', '2025-09-29 14:48:02', '2025-09-29 14:48:02'),(103, NULL, 'DCE.p2605', 'SELL', 'CLOSE', 3, 9004, '均线追踪止损', '2025-09-29 21:03:42', '2025-09-29 21:03:43'),(104, NULL, 'DCE.jm2601', 'SELL', 'CLOSE', 2, 1152.5, '均线追踪止损', '2025-09-30 10:39:10', '2025-09-30 10:39:11'),(105, NULL, 'DCE.j2601', 'SELL', 'CLOSE', 1, 1651.5, '均线追踪止损', '2025-09-30 10:39:13', '2025-09-30 10:39:14'),(107, NULL, 'DCE.pm2409', 'BUY', 'OPEN', 1, 6520, '测试插入', '2024-06-15 10:30:00', '2024-06-15 10:30:00'),(108, NULL, 'TEST001', 'BUY', 'OPEN', 1, 100.5, '测试交易记录功能', '2025-10-05 15:15:10', '2025-10-05 15:15:11'),(109, NULL, 'SHFE.ao2601', 'BUY', 'CLOSETODAY', 3, 2828, '均线追踪止损', '2025-10-13 11:20:00', '2025-10-13 11:20:01'),(110, NULL, 'SHFE.rb2605', 'SELL', 'CLOSETODAY', 8, 3130, '均线追踪止损', '2025-10-13 11:22:01', '2025-10-13 11:22:02'),(111, NULL, 'DCE.jm2601', 'SELL', 'CLOSE', 4, 1141, '均线追踪止损', '2025-10-13 11:24:00', '2025-10-13 11:24:01'),(112, NULL, 'DCE.p2605', 'SELL', 'CLOSE', 3, 9166, '均线追踪止损', '2025-10-13 11:27:00', '2025-10-13 11:27:01'),(113, NULL, 'TEST001', 'BUY', 'OPEN', 1, 100.5, '测试交易记录功能', '2025-10-13 11:34:03', '2025-10-13 11:34:04'),(114, NULL, 'SHFE.ao2601', 'SELL', 'CLOSETODAY', 3, 2817, '均线追踪止损', '2025-10-13 14:44:00', '2025-10-13 14:44:00'),(115, NULL, 'DCE.jm2601', 'SELL', 'CLOSE', 2, 1149, '均线追踪止损', '2025-10-13 14:46:01', '2025-10-13 14:46:01'),(116, NULL, 'DCE.i2601', 'SELL', 'CLOSE', 2, 781, '均线追踪止损', '2025-10-14 16:55:24', '2025-10-14 16:55:24'),(117, NULL, 'SHFE.rb2605', 'BUY', 'CLOSE', 4, 3116, '均线追踪止损', '2025-10-14 16:55:30', '2025-10-14 16:55:30'),(118, NULL, 'SHFE.ao2601', 'BUY', 'CLOSE', 6, 2807, '均线追踪止损', '2025-10-14 16:55:31', '2025-10-14 16:55:31'),(119, NULL, 'DCE.j2601', 'SELL', 'CLOSE', 1, 1624, '均线追踪止损', '2025-10-15 14:30:00', '2025-10-15 14:30:00'),(120, NULL, 'SHFE.rb2605', 'BUY', 'CLOSETODAY', 3, 3091, '均线追踪止损', '2025-10-15 14:35:01', '2025-10-15 14:35:01'),(121, NULL, 'DCE.y2609', 'BUY', 'CLOSE', 2, 7948, '均线追踪止损', '2025-10-15 14:35:02', '2025-10-15 14:35:02'),(122, NULL, 'DCE.j2601', 'BUY', 'CLOSE', 1, 1630, '均线追踪止损', '2025-10-15 14:36:01', '2025-10-15 14:36:01'),(123, NULL, 'CZCE.CF601', 'BUY', 'CLOSE', 4, 13285, '均线追踪止损', '2025-10-15 14:39:01', '2025-10-15 14:39:01');
UNLOCK TABLES;
COMMIT;
BEGIN;
LOCK TABLES `trade_monitor`.`user_sessions` WRITE;
DELETE FROM `trade_monitor`.`user_sessions`;
INSERT INTO `trade_monitor`.`user_sessions` (`id`,`user_id`,`session_token`,`expires_at`,`created_at`) VALUES (38, 1, '0c1663fdcf92912ffac64c6b062b991d2baeb8abeee572e7568214692f827a82', '2025-10-15 11:33:42', '2025-09-30 11:06:57');
UNLOCK TABLES;
COMMIT;
BEGIN;
LOCK TABLES `trade_monitor`.`users` WRITE;
DELETE FROM `trade_monitor`.`users`;
INSERT INTO `trade_monitor`.`users` (`id`,`username`,`password_hash`,`salt`,`is_active`,`is_admin`,`session_duration`,`last_login`,`created_at`,`updated_at`) VALUES (1, 'admin', '5c066b9548d803d7f0fd93f34a797ccb29a1b406a1bb8f672cc6f63fdb44a79a', 'f5b113efa178fa92445c9c02eecf5f9f', 1, 1, 360, '2025-10-15 05:33:42', '2025-09-07 10:10:05', '2025-10-15 13:33:42'),(3, 'szlwy68', 'c211b127b75a2c68666521c09fd2e0168249d30c74f0b6d48ccd54d93170c013', '1604f9d0634f5b5b9ec6f62dc53398aa', 1, 0, 360, NULL, '2025-09-07 20:21:05', '2025-09-07 21:45:07');
UNLOCK TABLES;
COMMIT;
